package com.liukai.exam.controller;


import com.liukai.exam.common.Result;
import com.liukai.exam.pojo.Schools;
import com.liukai.exam.service.IClassInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 班级信息表，存放学校，学院，专业，班级 前端控制器
 * </p>
 *
 * @author liu kai
 * @since 2021-02-01
 */
@RestController
@RequestMapping("/exam/classInfo")
public class ClassInfoController {

    @Autowired
    private IClassInfoService iClassInfoService;

    @GetMapping(value = "/getAllSchool")
    public Result getAllSchool(){


        List<Schools> allSchools = iClassInfoService.getAllSchools();
        int schoolId;
        for (int i = 0; i < allSchools.size(); i++) {
            schoolId = i + 100;
            allSchools.get(i).setSchoolId(schoolId);
        }

        Result result = Result.succ(200,"获取成功",allSchools);

        return result;
    }

}

